import request from '@/utils/request'

import Cookies from 'js-cookie'

// 查询借款列表
export function listLoan(query) {
  return request({
    url: '/loan/loan/list',
    method: 'get',
    params: query
  })
}

// 查询借款详细
export function getLoan(loanId) {
  return request({
    url: '/loan/loan/' + loanId,
    method: 'get'
  })
}

// 新增借款
export function addLoan(data) {
  return request({
    url: '/loan/loan',
    method: 'post',
    data: data
  })
}

// 修改借款
export function updateLoan(data) {
  return request({
    url: '/loan/loan',
    method: 'put',
    data: data
  })
}

// 删除借款
export function delLoan(loanId) {
  return request({
    url: '/loan/loan/' + loanId,
    method: 'delete'
  })
}
